<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>

    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>添加阶段</title>
    <script type='text/javascript' src='${base}/resources/js/lib/jquery.1.11.3.min.js'></script>
    <script type='text/javascript' src='${base}/resources/js/common.js'></script>
</head>
<style>
    span.error {
        color: red;
    }

    .input {
        margin: 0 10px;
        height: 25px;
        text-align: center;
    }

    .title {
        float: left;
        width: 100px;

        text-align: right;
    }

    .divTitle {
        margin-top: 10px;
    }
</style>
<body>
<form action="" method="post">
    <div style="margin:0 auto;width: 450px;height: 300px;margin-top:100px">

        <div>
            <div class="title">
                阶段名称：
            </div>
            <input type='text' class="input" id="name" name="name" placeholder='请输入用户名'
            <#--onblur="_changeUniqueValue('username')"-->
            >
            <span id="error_name" class="error"></span>
        </div>

        <div style="text-align: center;"></br>
            <button type="button" onclick="save()">提交</button>
        </div>
    </div>
</form>
</body>
<script>
    function save() {
        var value = $("input[name='name']").val();
        if ($.isBlank(value)) {
            $("#error_name").text("用户名不能为空");
            return false;
        }
        $.ajax({
            url: "${base}/admin/phase/save",
            type: "post",
            data: {name: value},
            success: function (data) {
                if (data.success) {
                    window.location.href =  "${base}/admin/phase/index";
                } else {
                    alert(data.msg);
                }
            }
        })
    }
</script>
</html>